package com.dd;

import com.dd.dao.UserDao;
import com.dd.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );

//        UserDao userDao = new UserMySqlDaoImpl();

        //获取IOC容器
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");

        UserDao userDao = (UserDao) ctx.getBean("userOracleDao");

        userDao.sayHello();

        UserService userService = ctx.getBean(UserService.class);

        userService.sayHello();
    }
}
